<!DOCTYPE html>
<html>
<head>
    <title>CORS Example</title>
    <script>
        async function fetchData() {
            try {
                const response = await fetch('http://localhost:31001/api/data', {
                    method: 'GET',
                    credentials: 'include'  // Include cookies if needed
                });
                if (!response.ok) {
                    throw new Error('Network response was not ok ' + response.statusText);
                }
                const data = await response.json();
                console.log('Received data:', data);
            } catch (error) {
                console.error('There was a problem with the fetch operation:', error);
            }
        }

        window.onload = fetchData;
    </script>
</head>
<body>
<h1>CORS Example</h1>
</body>
</html>
